<template>
    <div class="new-body">
        <div class="layout-wrapper">
            <head-part />
            <div class="content-wrapper">
                <router-view />
            </div>
            <friend-link />
        </div>
        <div class="foot-back">
            <copy-right/>
        </div>
        <cj-media v-if="isWeather"></cj-media>
    </div>
    
</template>

<script>
import headPart from './header/index.vue'
import friendLink from './footer/friendLink.vue'
import copyRight from './footer/copyRight.vue'
import cjMedia from './common/cjMedia.vue'


export default {
    name: 'layout',
    components: {
        headPart,
        friendLink,
        copyRight,
        cjMedia
    },
    data: function() {	
        return {
        }
    },
    methods: {},
    computed: {
        isWeather() {
            return this.$store.state.isWeather;
        }
    },
    mounted() {
        // this.$$http('GET_NEWS_LIST')
        // this.$$http('GET_CURRENT_USER')
        // console.log(this.$emitter)
        if(localStorage.routeToggle || this.$store.state.routeTarget || localStorage.mk == 'null' || !localStorage.mk){
            return
        }
        if(localStorage.mk){
            let mk = localStorage.mk.split(',')[0];
            this.$router.push(`/content/${mk}`);
        }
    }
}
</script>

<style lang="scss">
.new-body{
    position: relative;
    .layout-wrapper{
        height: 100%;
        width: 1200px;
        margin: 0 auto;
        position: relative;
        .content-wrapper{
            // border: 1px solid #000;
            height: 100%;
            min-height: 540px;
            background: #fff;
            margin-top: 30px; 
        }
        // height: 988px;
    }
    .foot-back{
        // position: absolute;
        // left: 0;
        // bottom: 0;
        width: 100%;
        height: 50px;
        margin-top: 20px;
        background: #315FAC
    }
}

</style>